home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / wf314.zip / WF311DOC.ZIP / DOCS / WF.017 < prev    next >
Text File  |  1992-01-31  |  21KB  |  586 lines

  1. .f3                              - # -              Chapter 17 - Mail Merge
  2. .rm70
  3. .tc
  4. .tc 17. MAIL MERGE ........................................#
  5. CHAPTER 17   MAIL MERGE
  6.  
  7. .imData Files
  8. .imMerge Printing
  9. .irFormletters;Formletters - see Merge Printing
  10. Mail Merge, or Merge Printing, is the process of inserting information
  11. into a document while it is being printed. The document is often
  12. printed several times with different information. The most common use
  13. of merge printing is to merge mailing list information into a form
  14. letter or mailing labels. Other applications include invoices,
  15. reports, and any other standard document that requires you to fill in
  16. blanks.
  17.  
  18. .ix   Master Document
  19. .ix   Template Document
  20. To merge print you need to create the form or template document (also
  21. called the master document). You usually need a data file as well. You
  22. then print the master document using the background print command Ctrl
  23. K P. Word fugue will obey the mail merge dot commands, and insert
  24. information in place of variables in your master document. If you are
  25. using a data file, a copy of the document will be produced for each
  26. set of information in the data file.
  27.  
  28. A master document contains the text of the document and the
  29. instructions for how the documents are to be produced. These
  30. instructions include variables and special merge print dot commands.
  31. An example would be a form letter and a data file of names and
  32. addresses.
  33.  
  34. .tc    Variables ..........................................#
  35. Variables
  36. .ix   Variables
  37. .ix   Mail merge labels
  38. .ixAmpersands;Ampersands in Master Document
  39. .ixLabels,;Labels, merge printing
  40. .ixFields;Fields
  41. .ixFields;Field Names
  42.  
  43. A variable is information that changes from one copy of the document
  44. to another. When you merge print, Word Fugue inserts information for
  45. each variable into each copy. This information can come from a data
  46. file, or you can be prompted for it when you print.
  47.  
  48. Each variable has a name, and you place the name of the variable into
  49. the master document wherever information is to be inserted. The actual
  50. information inserted in place of the variable is called data.
  51.  
  52. A variable name can contain up to 20 characters. You can use uppercase
  53. and lowercase letters interchangeably. You can make a name more
  54. readable by using hyphens (-) or underscores (_) to join words in the
  55. variable name.
  56.  
  57. Where you want to insert variable data, type the variable name between
  58. ampersands (&) in the text of the document:
  59.  
  60.    &person-name&                         Fred Nurk
  61.    &ADDress_1&                           The street
  62.    &city&, &state& &postcode&            Erehwon, XYZ 9000
  63.  
  64. If you have never set a value for a variable, it is termed
  65. uninitialised. These variables print their own name, to aid you in
  66. finding them. They usually happen when you misspell their name. word
  67. Fugue cannot match the misspelling, and so prints the name instead.
  68.  
  69. .tc    Merge Print Dot Commands ...........................#
  70. Merge Print Dot Commands
  71. .ix   Dot Commands
  72.  
  73. You type dot commands in the master document to tell Word Fugue the
  74. variable names and where to get the data that goes into them. If you
  75. do not obtain data for a variable name, Word Fugue will print the name
  76. instead. You cannot use a piece of data which is longer than 80
  77. characters. The total amount of data to be merged is limited by the
  78. memory available on your PC.
  79.  
  80. The following dot commands are available:
  81.  
  82.                 .DF filename delim
  83.                 .RV variable list
  84.                 .AV prompt,variable
  85.                 .SV variable=value
  86.                 .MA variable=equation
  87.                 .DM message
  88.                 .GO go to top of file and start again
  89.                 .WS Y or N for Wordstar compatible variable
  90.                     replacement
  91.  
  92. .ixDot Commands;  .DF - Data File
  93. .ix   Dot Commands
  94. .ix   Data File (.DF)
  95. .ixDF;.DF - Data File
  96. .ixData Files;   Selecting for merge printing (.DF)
  97. The .DF command defines the data file containing the variables to be
  98. merged into the text. If you follow the filename by at least one
  99. blank and another character, then that character is used as a
  100. delimiter instead of a comma
  101.  
  102.         eg .DF names.dat /
  103.  
  104. means that the file NAMES.DAT contains the variables to be read, and
  105. that the separator between variables is a slash (/). The default is
  106. comma (,).
  107.  
  108. .ixDot Commands;  .RV - Read Variable
  109. .ix   Read Variable .RV
  110. .ix   Data Files
  111. .ixCommas;Commas in data files
  112. .ixData Files;   Creating
  113. .ixData Files;   Examples
  114.  
  115. .ixRV;.RV - Read Variable
  116. .ixData Files;   Naming fields for merge printing (.RV)
  117. A data file consists of a series of records. Each record consists of
  118. one or more fields or items of information. For example, a mailing
  119. list has a field for name, a field for address line one, and a field
  120. for address line 2.
  121.  
  122. The .RV command defines the variables to be found on a single line of
  123. the data file. You can have more that one .RV to define different
  124. lines of your master document. If a line of the data file is exhausted
  125. before all the variables are read, the remainder are set to blank.
  126.  
  127.         eg .RV name,address1,address2
  128.  
  129. means that each line of the file will look like this:
  130.  
  131.         Joe Bloggs,17 West street,Newtown DG 9999
  132.  
  133. If you want to leave a variable blank, then leave it out:
  134.  
  135.         Joe Bloggs,,Newtown Post Office DG 9999
  136.  
  137. You can use a different separator, as defined on the .DF line, and put
  138. different variables on different lines:
  139.  
  140.         .DF names.dat /
  141.         .rv name,address1
  142.         .rv address2
  143.  
  144. .cp7
  145. Your file would then look like this:
  146.  
  147.         Joe Bloggs/17 Westside Ave.,
  148.         Newtown DG 9999
  149.  
  150. .ixData Files;   Creating
  151. Make sure that the fields are in the same order in all records.
  152. Separate fields with commas or the separator you defined on the .DF
  153. line. Make sure that the fields on a record are consistent with the
  154. order you defined in the .RV line(s). If a field contains a comma,
  155. enclose the entire field in quotation marks. If a field is empty (you
  156. have no information for it in this record), indicate the blank field
  157. with a space and a comma.
  158.  
  159. NOTE - The rules above are very important. If you enter data
  160.        incorrectly, your merge printing will not print correctly.
  161.  
  162. .ixDot Commands;  .AV - Ask for Variable
  163. .ix   Dot Commands
  164. .ix   Ask for Variable .AV
  165. .ixAV;.AV - Ask for Variable
  166. The .AV line will prompt you to enter the contents of the variable.
  167. You can include an optional prompt:
  168.  
  169.         .AV Address1
  170.  
  171. will display   ADDRESS1?  and open a window for you to enter the
  172. value.
  173.  
  174.         .AV Enter the address,address1
  175.  
  176. will display  Enter the address  and open a window for you to enter
  177. the value.
  178.  
  179. .ixDot Commands;  .SV - Set Variable
  180. .ix   Set Variable (.SV)
  181. .ixSV;.SV - Set Variable
  182. The .SV line sets the variable to the value:
  183.  
  184.         .SV vara,this is the value for variable A
  185.         .SV addr= This is the address
  186.  
  187. You can use either comma (,) or equals sign (=). Leading spaces in the
  188. variable are ignored. If you want to include leading spaces, you
  189. should enclose the data within single or double quotes. If you start
  190. with a single quote, you must end with a single quote, and vice
  191. versa:
  192.  
  193.         .SV company= "   Fugue Software  "
  194.  
  195. You can set the maximum length of a variable by placing the characters
  196. /L and a length, or /R and a length, or /C and a length, depending on
  197. whether you want your data Left justified or Right justified or
  198. Centred, after the variable name:
  199.  
  200.         .SV A/L15=Joe Bloggs
  201.         .SV B/R15=Joe Bloggs
  202.         .SV C =Joe Bloggs
  203.         .SV D/C15=Joe Bloggs
  204.  
  205.         gives
  206.            A = "Joe Bloggs     "
  207.            B = "     Joe Bloggs"
  208.            C = "Joe Bloggs"
  209.            D = "   Joe Bloggs  "
  210.  
  211. If the line were too long, it would be truncated at the length
  212. specified.
  213.  
  214. .ixDot Commands;  .MA - Mathematical Calculations
  215. .ix   Mathematical calculations .MA
  216. .ixMA;.MA - Mathematical calculations
  217. The .MA line allows you to compute values a